<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="box">

  </div>
  <script>
    //获取元素
    var box = document.getElementById("box");
    //模拟数据
    var arr = ["张三","李四","王五","刘备","曹操","孙权"];
    
    //创建ul
    var ul = document.createElement("ul");
    //添加ul到box中
    box.appendChild(ul);
    //根据数组的元素动态添加数据
    for (let i = 0; i < arr.length; i++) {
      //创建li
      var li = document.createElement("li");
      //把li添加进ul
      ul.appendChild(li);
      //输入li的文字
      li.innerText = arr[i];
    }
  </script>
</body>
</html>